﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MissionEditor.ConditionUI
{
    public partial class Timer : UserControl, IConditionUI
    {
        Condition condition;
        public Timer(Condition condition)
        {
            this.condition = condition;
            InitializeComponent();

            timeTextBox.Text = BitConverter.ToUInt32(condition.raw, 0).ToString();
            comparisonFunctionComboBox.SelectedIndex = condition.raw[27];
        }
        public void Apply()
        {
            BitConverter.GetBytes(Convert.ToUInt32(timeTextBox.Text)).CopyTo(condition.raw, 0);
            condition.raw[27] = (byte)comparisonFunctionComboBox.SelectedIndex;
        }
    }
}
